<style>
    .goods-shop-type button{
        padding: 10px;
        border: none;
        font-size: 14px;
        color: #f63e2c;
    }
    .goods-shop-type .active-type{
        background-color: #f63e2c;
        color: #fff;
    }
    .page-item{
        list-style: none;
        display: inline-block;
        padding: 5px;
    }
    .curr-item{
        background-color: #444c69;
        padding: 5px;
    }
</style>
{if $show_tab == 1}
<div class="alert alert-success-light goods-shop-type">
    <button class="active-type goods-shop-type-item" data-url="{:url('item/item/index')}">本店卡项</button>
    <button class="goods-shop-type-item" data-url="{:url('item/item/topgoods')}">总部卡项</button>
</div>
{/if}
<div class="panel panel-default panel-intro">
    
    <div class="panel-heading">
        {:build_heading(null,FALSE)}
        <ul class="nav nav-tabs" data-field="type">
            <li class="{:$Think.get.type === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
            {foreach name="typeList" item="vo"}
            <li class="{:$Think.get.type === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
            {/foreach}
        </ul>
    </div>


    <div class="panel-body">
        <div id="myTabContent" class="tab-content">
            <div class="tab-pane fade active in" id="one">
                <div class="widget-body no-padding">
                    <div id="toolbar" class="toolbar">
                        <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
                        <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('item/item/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
                        <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('item/item/del')?'':'hide'}" title="{:__('Delete')}" >{:__('Delete')}</a>
                        {if $show_copy == 1}
                        <a href="javascript:;" class="btn btn-warning btn-resubmit btn-disabled disabled {:$auth->check('item/item/resubmit')?'':'hide'}" title="{:__('铺设')}" >{:__('铺设')}</a>
                        <a href="javascript:;" class="btn btn-warning btn-batch btn-disabled disabled {:$auth->check('item/item/batch')?'':'hide'}" title="{:__('批量下架')}" >{:__('批量下架')}</a>
                        <a href="javascript:;" class="btn btn-warning btn-batchprice btn-disabled disabled {:$auth->check('item/item/batchprice')?'':'hide'}" title="{:__('批量编辑')}" >{:__('批量编辑')}</a>
                        {/if}
                        <div class="dropdown btn-group {:$auth->check('item/item/multi')?'':'hide'}">
                            <a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
                            <ul class="dropdown-menu text-left" role="menu">
                                <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('上架')}</a></li>
                                <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('下架')}</a></li>
                            </ul>
                        </div>

                        <!-- <a class="btn btn-success btn-recyclebin btn-dialog {:$auth->check('item/item/recyclebin')?'':'hide'}" href="item/item/recyclebin" title="{:__('Recycle bin')}"><i class="fa fa-recycle"></i> {:__('Recycle bin')}</a> -->

                    </div>
                    <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
                           data-operate-edit="{:$auth->check('item/item/edit')}"
                           data-operate-del="{:$auth->check('item/item/del')}"
                           width="100%">
                    </table>
                </div>
            </div>

        </div>
    </div>
</div>
<!-- 子列表模态框 -->
<div class="modal fade" id="sublistModal" tabindex="-1" role="dialog" aria-labelledby="sublistModalLabel">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="sublistModalLabel">商品在售店铺列表</h4>
            </div>
            <div class="modal-body">
                <div class="loading text-center">
                    <i class="fa fa-spinner fa-spin fa-2x"></i>
                </div>
                <div class="table-responsive hide">
                    <table class="table table-bordered table-hover" id="sublistTable">
                        <thead>
                            <tr>
                                <th>ID</th>
                                <th>店铺名称</th>
                                <th>联系人</th>
                                <th>联系电话</th>
                                <th>所属地区</th>
                            </tr>
                        </thead>
                        <tbody id="sublistBody"></tbody>
                    </table>
                </div>
                <div class="text-center text-danger hide" id="sublistEmpty">暂无在售店铺</div>
                <!-- 分页控件 -->
                <div class="pagination-container flex flex-col sm:flex-row justify-between items-center mt-6 pt-4 border-t border-gray-200">
                    <div id="paginationInfo" class="mb-4 sm:mb-0"></div>
                    <nav class="flex items-center">
                        <ul id="sublistPagination" class="inline-flex items-center -space-x-px"></ul>
                    </nav>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
</div>